import axios from "axios"
import { showToast,showFailToast,showSuccessToast,showLoadingToast, } from 'vant';

// 	https://service-kq8d34ry-1322805030.gz.tencentapigw.com/release/

axios.defaults.withCredentials = true // 允许跨域设置，不然可能因为拿不到cookie而报错

const Service = axios.create({
    timeout: 3000,
    baseURL: "https://service-kq8d34ry-1322805030.gz.tencentapigw.com/release/",
    headers: {
        "Content-type": "application/json;charset=utf-8",
        // "Authorization":store.state.uInfo.userInfo.token
    }
})



// post请求
export const post = config => {
    return Service({
        ...config,
        method: "post",
        data: config.data
    })
}
// get请求
export const get = config => {
    return Service({
        ...config,
        method: "get",
        params: config.data
    })
}
// put请求
export const put = config => {
    return Service({
        ...config,
        method: "put",
        data: config.data
    })
} // delete请求
export const del = config => {
    return Service({
        ...config,
        method: "delete"
    })
}